﻿<UserControl
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	xmlns:Phone7ActionPack_Controls="clr-namespace:Phone7ActionPack.Controls;assembly=Phone7ActionPack"
	mc:Ignorable="d"
	x:Class="Phone7ActionPack_SampleApp1.LocationApproach2"
    xmlns:Phone7ActionPack_ValueConverters="clr-namespace:Phone7ActionPack.ValueConverters;assembly=Phone7ActionPack" 
	d:DesignWidth="480" d:DesignHeight="710" FontSize="{StaticResource PhoneFontSizeNormal}">
	<UserControl.Resources>
        <Phone7ActionPack_ValueConverters:TimeAgoValueConverter x:Key="TimeAgoValueConverter"/>
        <Phone7ActionPack_ValueConverters:DDtoDMSValueConverter x:Key="DDtoDMSValueConverter1"/>
        <Phone7ActionPack_ValueConverters:DDtoDMSValueConverter x:Key="DDtoDMSValueConverter"/>
        <DataTemplate x:Key="PastLocations">
            <Grid d:DesignWidth="285" d:DesignHeight="51">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="144"/>
                    <ColumnDefinition/>
                </Grid.ColumnDefinitions>
                <TextBlock x:Name="LocationTime" TextWrapping="Wrap" Text="{Binding Timestamp, Converter={StaticResource TimeAgoValueConverter}}" Visibility="Collapsed"/>
                <StackPanel Grid.Column="1" d:LayoutOverrides="Width" Orientation="Horizontal">
                    <TextBlock x:Name="Latitude" TextWrapping="Wrap" Text="{Binding Location.Latitude, ConverterParameter=latitude, Converter={StaticResource DDtoDMSValueConverter}}"/>
                    <TextBlock TextWrapping="Wrap" Text="," d:LayoutOverrides="Height" Margin="2,0,4,0"/>
                    <TextBlock x:Name="Longitude" TextWrapping="Wrap" Text="{Binding Location.Longitude, ConverterParameter=longitude, Converter={StaticResource DDtoDMSValueConverter1}}" Width="205"/>
                </StackPanel>
            </Grid>
        </DataTemplate>
	</UserControl.Resources>

	<Grid x:Name="LayoutRoot" Background="{StaticResource PhoneBackgroundBrush}">
		<Grid.RowDefinitions>
			<RowDefinition Height="100"/>
			<RowDefinition Height="0.362*"/>
			<RowDefinition Height="0.638*"/>
		</Grid.RowDefinitions>
		<Phone7ActionPack_Controls:LocationControl x:Name="LocationControl" VerticalAlignment="Top" Height="30"/>
		<ToggleButton x:Name="WatcherEnabled" Content="ToggleButton" HorizontalAlignment="Left" Height="4" Style="{StaticResource PhoneToggleSwitch}" Width="0" IsChecked="{Binding LocationWatcherEnabled, ElementName=LocationControl, Mode=TwoWay}"/>
		<TextBlock x:Name="WatcherEnabledLabel" HorizontalAlignment="Right" TextWrapping="Wrap" Text="Location Watcher Enabled" FontSize="{StaticResource PhoneFontSizeMediumLarge}" Foreground="{StaticResource PhoneForegroundBrush}" Margin="0,34,34,29" d:LayoutOverrides="Height"/>
		<Grid Grid.Row="1" Margin="2">
			<Grid.RowDefinitions>
				<RowDefinition Height="0.25*"/>
				<RowDefinition Height="0.25*"/>
				<RowDefinition Height="0.25*"/>
				<RowDefinition Height="0.25*"/>
			</Grid.RowDefinitions>
			<Grid.ColumnDefinitions>
				<ColumnDefinition Width="0.487*"/>
				<ColumnDefinition Width="0.513*"/>
			</Grid.ColumnDefinitions>
			<TextBlock x:Name="LatitudeLabel" HorizontalAlignment="Right" TextWrapping="Wrap" Text="Latitude" VerticalAlignment="Center" FontSize="{StaticResource PhoneFontSizeMediumLarge}" Foreground="{StaticResource PhoneForegroundBrush}" Margin="0,0,4,0"/>
			<TextBlock x:Name="Latitude" HorizontalAlignment="Left" TextWrapping="Wrap" Text="{Binding Latitude, ElementName=LocationControl}" VerticalAlignment="Center" FontSize="{StaticResource PhoneFontSizeMediumLarge}" Foreground="{StaticResource PhoneForegroundBrush}" Margin="4,0" Grid.Column="1"/>
			<TextBlock x:Name="LongitudeLabel" HorizontalAlignment="Right" TextWrapping="Wrap" Text="Longitude" VerticalAlignment="Center" FontSize="{StaticResource PhoneFontSizeMediumLarge}" Foreground="{StaticResource PhoneForegroundBrush}" Grid.Row="1" Margin="0,0,4,0"/>
			<TextBlock x:Name="Longitude" HorizontalAlignment="Left" TextWrapping="Wrap" Text="{Binding Longitude, ElementName=LocationControl}" VerticalAlignment="Center" FontSize="{StaticResource PhoneFontSizeMediumLarge}" Foreground="{StaticResource PhoneForegroundBrush}" Margin="4,0,0,0" Grid.Column="1" Grid.Row="1"/>
			<TextBlock x:Name="VerticalAccuracyLabel" HorizontalAlignment="Right" TextWrapping="Wrap" Text="Vertical Accuracy" VerticalAlignment="Center" FontSize="{StaticResource PhoneFontSizeMediumLarge}" Foreground="{StaticResource PhoneForegroundBrush}" Grid.Row="2" ToolTipService.ToolTip="Horizontal Accuracy" Margin="0,0,4,0"/>
			<TextBlock x:Name="VerticalAccuracy" HorizontalAlignment="Left" TextWrapping="Wrap" Text="{Binding VerticalAccuracy, ElementName=LocationControl}" VerticalAlignment="Center" FontSize="{StaticResource PhoneFontSizeMediumLarge}" Foreground="{StaticResource PhoneForegroundBrush}" Margin="4,0,0,0" Grid.Column="1" Grid.Row="2"/>
			<TextBlock x:Name="HorizontalAccuracyLabel" HorizontalAlignment="Right" TextWrapping="Wrap" Text="Horizontal Accuracy" VerticalAlignment="Center" FontSize="{StaticResource PhoneFontSizeMediumLarge}" Foreground="{StaticResource PhoneForegroundBrush}" Grid.Row="3" Margin="0,0,4,0"/>
			<TextBlock x:Name="HorizontalAccuracy" HorizontalAlignment="Left" TextWrapping="Wrap" Text="{Binding HorizontalAccuracy, ElementName=LocationControl}" VerticalAlignment="Center" FontSize="{StaticResource PhoneFontSizeMediumLarge}" Foreground="{StaticResource PhoneForegroundBrush}" Margin="4,0,0,0" Grid.Column="1" Grid.Row="3"/>
		</Grid>
		<ItemsControl x:Name="LocationHistory" Grid.Row="2" ItemsSource="{Binding History, ElementName=LocationControl}" ItemTemplate="{StaticResource PastLocations}" Foreground="{StaticResource PhoneForegroundBrush}"/>
	</Grid>
</UserControl>